import { LoginForm } from "../components/User/Login";
import { RegisterForm } from "../components/User/Register";
import axios, { baseURL } from "./http";

export async function doLogin(data: LoginForm) {
  const result = await axios.post(`${baseURL}/login`, {
    user: data
  });
  return result;
}

export async function doRegister(data: RegisterForm) {
  const result = await axios.post(`${baseURL}/register`, {
    user: data
  });
  return result;
}

export async function getUserInfo() {
  const result = await axios.get(`${baseURL}/getUserInfo`);
  return result;
}

export async function getAllUsers() {
  const result = await axios.get(`${baseURL}/getAllUsers`);
  return result;
}